package com.mark.service;

import com.mark.common.ServerResponse;
import com.mark.exception.UserException;
import com.mark.pojo.User;
import com.mark.vo.UserVo;

/**
 * Created by Mark on 2018/3/22.
 * 用户模块的接口设计
 */
public interface IUserService {
    ServerResponse<User> login(String username, String password) throws UserException;

    ServerResponse<String> register(User user) throws UserException;

    ServerResponse<String> checkValid(String str, String type) throws UserException;

    ServerResponse<UserVo> getInfo(Integer currentUser);

    ServerResponse<String> selectQuestion(String username) throws UserException;

    ServerResponse<String> checkAnswer(String username, String question, String answer) throws UserException;

    ServerResponse<String> forgetResetPassword(String username, String passwordNew, String forgetToken) throws UserException;

    ServerResponse<String> resetPassword(String passwordOld, String passwordNew, User user) throws UserException;

    ServerResponse<UserVo> updateInformation(User user) throws UserException;

    ServerResponse updateImageUrl(Integer currentUserId, String imageUrl);

    //------------------------以下是实现后台接口业务的接口定义------------------------------------------
    ServerResponse getUserList(int pageNum, int pageSize);

    ServerResponse setUserEnableStatus(Integer userId, Integer newStatus, String remark);

    ServerResponse searchUsers(int pageNum, int pageSize, String userName, Integer userId, Integer status);
}
